//
//  ViewController.m
//  作业
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "LYLabel.h"



@interface ViewController ()

@property (nonatomic, retain) NSArray *array1;
@property (nonatomic, retain) NSArray *array2;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self creatLabel];
    [self creatImage];
    [self detailOfActivity];
    [self creatContent];
    
}

-(void)creatData
{
    NSArray *array = @[@"[新专辑2014全国巡演合作咨询]",@"@蒋步庭",@"微博http://www.weibo.com", @"微博http://www.weibo.com", @"豆瓣http://www.douban.com", @"QQ1193657158", @"邮箱:1193657158@qq.com", @"手机18610967776", @"[赵雷巡演两千人群241855614]", @"[赵雷歌迷北京活动群241855614]", @"------------------------", @"赵雷2014新专辑<<吉姆餐厅>>首发演唱会,北京站", @"演出时间:10月19日"];
    self.array1 = array;
}


-(void)creatLabel
{
    LYLabel *titleLabel = [[LYLabel alloc]initWithFrame:CGRectMake(10, 40, self.view.frame.size.width - 20, 60) withTitle:@"赵雷2014新专辑<<吉姆餐厅>>首发演唱会,北京站"];
    titleLabel.font = [UIFont systemFontOfSize:22];
    titleLabel.numberOfLines = 0;
    titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
    [self.view addSubview:titleLabel];
}

//创建图片
-(void)creatImage
{
    UIImage *image = [UIImage imageNamed:@"image.jpg"];
    UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
    imageView.frame = CGRectMake(10, 110, self.view.frame.size.width / 3, 200);
//    imageView.backgroundColor = [UIColor blackColor];
    [self.view addSubview:imageView];
}

//活动详细情况
-(void)detailOfActivity
{
    CGFloat weidth = self.view.frame.size.width;
    //时间
    LYLabel *timeLabel = [[LYLabel alloc]initWithFrame:CGRectMake(190, 110, weidth / 3 * 2 - 40, 30) withTitle:@"10-19 18:00 -- 10-19 23:30"];
    [self.view addSubview:timeLabel];
    
    //主办方
    LYLabel *ownerLabel = [[LYLabel alloc]initWithFrame:CGRectMake(190, 150, weidth / 3 * 2 - 40, 30) withTitle:@"赵雷"];
    [self.view addSubview:ownerLabel];
    
    //活动类型
    LYLabel *catagoryLabel = [[LYLabel alloc]initWithFrame:CGRectMake(190, 190, weidth / 3 * 2 - 40, 30) withTitle:@"类型:音乐"];
    [self.view addSubview:catagoryLabel];
    
    //活动地址
    LYLabel *addressLabel = [[LYLabel alloc]initWithFrame:CGRectMake(190, 230, weidth / 3 * 2 - 40, 30) withTitle:@"北京 东城区 背景东城区和平里西街79号糖果大楼三楼"];
    addressLabel.numberOfLines = 0;
    
    [self.view addSubview:addressLabel];
}


//活动内容
-(void)creatContent
{
    CGFloat weidth = self.view.frame.size.width;
    
    LYLabel *label1 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 340, weidth - 45, 30) withTitle:@"活动介绍"];
    label1.font = [UIFont systemFontOfSize:22];
    [self.view addSubview:label1];

//    LYLabel *label2 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 375, weidth * 0.8, 30) withTitle:@"[新专辑2014全国巡演合作咨询]"];
//    [self.view addSubview:label2];
//    
//    LYLabel *label3 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 395, weidth * 0.8, 30) withTitle:@"@蒋步庭"];
//    [self.view addSubview:label3];
//    
//    LYLabel *label4 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 415, weidth * 0.8, 30) withTitle:@"微博http://www.weibo.com"];
//    [self.view addSubview:label4];
//    
//    LYLabel *label5 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 435, weidth * 0.8, 30) withTitle:@"豆瓣http://www.douban.com"];
//    [self.view addSubview:label5];
//    
//    LYLabel *label6 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 455, weidth * 0.8, 30) withTitle:@"QQ1193657158"];
//    [self.view addSubview:label6];
//    
//    LYLabel *label7 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 475, weidth * 8, 30) withTitle:@"邮箱:1193657158@qq.com"];
//    [self.view addSubview:label7];
//    
//    LYLabel *label8 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 495, weidth * 0.8, 30) withTitle:@"手机18610967776"];
//    [self.view addSubview:label8];
//    
//    LYLabel *label9 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 515, weidth * 0.8, 30) withTitle:@"[赵雷巡演两千人群241855614]"];
//    [self.view addSubview:label9];
//    
//    LYLabel *label10 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 535, weidth * 0.8, 30) withTitle:@"[赵雷歌迷北京活动群241855614]"];
//    [self.view addSubview:label10];
    
//    LYLabel *label10 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 555, weidth * 0.8, 30) withTitle:@"------------------------"];
//    [self.view addSubview:label10];
    
//    LYLabel *label11 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 575, weidth * 0.8, 30) withTitle:@"赵雷2014新专辑<<吉姆餐厅>>首发演唱会,北京站"];
//    [self.view addSubview:label11];
    
//    LYLabel *label12 = [[LYLabel alloc]initWithFrame:CGRectMake(10, 595, weidth * 0.8, 30) withTitle:@"演出时间:10月19日"];
//    [self.view addSubview:label12];
    
    
    for (int i = 0; i < self.array1.count ;i++) {
        LYLabel *label = [[LYLabel alloc]initWithFrame:CGRectMake(10, 375 + i * 20, weidth * 0.8, 30) withTitle:self.array1[i]];
        [self.view addSubview:label];
    }
    
    
    
}

















@end
